package mBio;

import java.io.*;
import java.util.*;
import rfBio.*;


public class join_columns {

	public static void main(String[] args) 
						throws IOException, FileNotFoundException {
		// local variables
		blastm8 ref = new blastm8();
		blastm8 tempblast = new blastm8();
		Vector blastm8Vector = new Vector(100, 100);
		String o_filename = new String();
		String out_string = new String();



		// ***************************************************
		// read file section
		// ***************************************************
		
		// open files
		BufferedReader fileOne = new BufferedReader ( new FileReader (args[0]));
		BufferedReader fileTwo = new BufferedReader ( new FileReader (args[1]));
		PrintWriter o_file = new PrintWriter(new BufferedWriter(new FileWriter(args[2])));
		
		// read files
		while (true){
			String lineOne = fileOne.readLine();
			String lineTwo = fileTwo.readLine();

			if ( (lineOne == null) && (lineTwo == null) )
			{
				break;
			}	
			
			if ( (lineOne == null) )
			{
				System.out.println("File one has fewer lines than file two");
				break;
			}			
			
			if ( (lineTwo == null) )
			{
				System.out.println("File two has fewer lines than file one");
				break;
			}	
			
			out_string = "";
			out_string = out_string + lineOne + "\t" + lineTwo;
			o_file.println(out_string);
		}	
		fileOne.close();
		fileOne.close();
		o_file.close();
		
	} // end main
}
